﻿using MDPM.EntitiyModels.BusinessOrganization;
using MDPM.EntitiyModels.BusinessTenants;
using MDPM.EntitiyModels.CommodityBusiness.HospitalDepartment;
using MDPM.EntitiyModels.Common;
using MDPM.EntitiyModels.MedicalDeviceManagement;
using MDPM.EntitiyModels.ProjectManage.FinanceRelevant;
using MDPM.EntitiyModels.ProjectManage.ProjectRelevant;
using MDPM.EntitiyModels.ProjectManage.PurchaseGroupRelevant;
using MDPM.EntitiyModels.ProjectManage.PurchasingLeadingGroupRelevant;
using MDPM.EntitiyModels.ProjectManage.WorkLogRelevant;
using MDPM.EntitiyModels.UserAndRoles;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Text;

namespace MDPM.ORM
{
    /// <summary>
    /// 关系数据库映射上下文关系
    /// </summary>
    public class MDPMDbContext : DbContext
    {
        public MDPMDbContext(DbContextOptions<MDPMDbContext> options) : base(options)
        {

        }
        #region 租户相关
        public DbSet<Tenant> Tenants { get; set; }
        #endregion

        #region 组织相关
        public DbSet<Organization> Organizations { get; set; }
        public DbSet<OrganizationDepartment> OrganizationDepartments { get; set; }
        public DbSet<OrganizationDepartmentEmployee> OrganizationDepartmentEmployees { get; set; }
        public DbSet<OrganizationDepartmentWithOrganizationDepartmentEmployee> OrganizationDepartmentWithOrganizationDepartmentEmployees { get; set; }

        #endregion

        #region 住址
        public DbSet<CommonAddress> CommonAddresss { get; set; }

        #endregion


        #region 用户、角色、用户与角色
        public DbSet<AppUser> AppUsers { get; set; }
        public DbSet<AppRole> AppRoles { get; set; }
        public DbSet<AppUseWithAppRole> AppUseWithAppRoles { get; set; }
        #endregion
        #region 部门需求
        public DbSet<HospitalDepartmentDemand> HospitalDepartmentDemands { get; set; }
        #endregion

        #region 采购领导小组
        public DbSet<PurchasingLeadingGroupMeber> PurchasingLeadingGroupMebers { get; set; }
        #endregion

        #region 项目相关
        public DbSet<Project> Projects { get; set; }
        /// <summary>
        /// 项目采购小组
        /// </summary>
        public DbSet<PurchaseGroup> PurchaseGroups { get; set; }
        /// <summary>
        /// 项目采购小组成员
        /// </summary>
        public DbSet<PurchaseGroupMember> PurchaseGroupMembers { get; set; }
        /// <summary>
        /// 项目里程碑
        /// </summary>
        public DbSet<ProjectMileStone> ProjectMileStones { get; set; }
        /// <summary>
        /// 项目工作
        /// </summary>
        public DbSet<ProjectWork> ProjectWorks { get; set; }
        /// <summary>
        /// 项目任务
        /// </summary>
        public DbSet<ProjectTask> ProjectTasks { get; set; }
        /// <summary>
        /// 任务障碍
        /// </summary>
        public DbSet<ProjectObstacle> ProjectObstacles { get; set; }
        /// <summary>
        /// 项目财务
        /// </summary>
        public DbSet<Finance> Finances { get; set; }
        /// <summary>
        /// 财务条目
        /// </summary>
        public DbSet<FinanceItem> FinanceItems { get; set; }
        /// <summary>
        /// 工作日志类
        /// </summary>
        public DbSet<WorkLog> WorkLogs { get; set; }
        /// <summary>
        /// 医疗器械类
        /// </summary>
        public DbSet<MedicalDevice> MedicalDevices { get; set; }
        /// <summary>
        /// 医疗器械维修记录
        /// </summary>
        public DbSet<MaintenanceRecords> MaintenanceRecordss { get; set; }

        #endregion

        protected override void OnModelCreating(ModelBuilder builder)
        {
            base.OnModelCreating(builder);

        }
    }
}
